/*
 * @Author: silence
 * @Date: 2022-05-14 11:39:53
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-04-15 16:40:02
 * @Description: 应用信息-单例类
 */

import 'dart:io';

/**app id */
const bool kTest = false;

const String AppId = "qz62ruxpnmgjw24b9sgl";
const String AppKey = "r2zp8d1orgf6m1pbeu7jyaf8kepqhq60";

// 设置代理地址
const String PROXY_PATH = ''; //'PROXY 192.168.2.51:8888';

const String BaseUrl = kTest
    ? "http://192.168.2.73:9003/"
    : "http://app.epchance.com:9003/"; // "http://data.epchance.com:9003/"; //

const String imgUrl = 'http://ceshi-yunmell.oss-cn-beijing.aliyuncs.com/';

const String Country = 'zh';

/**请求每页数据的个数*/
const int PageLimit = 10;
const int RequestTimeout = 30000;

/**app名称 */
const String APP_NAME = 'Lenercom EMS';
/**是否同意版本协议 */
const String APP_VERSION_AGREE = 'versionAgree';
/**是否显示同意版本协议弹窗 */
const bool SHOW_VERSION_AGREE = true;

const String authKey = "Authorization";

// bundleid
const String kIOSAppId = "1606687293";
const String kAndroidPackageId = "com.csxm.redenvelope";
const String kIOSBundleId = "com.csxm.redenvelope";
final String kAppBundleId = Platform.isIOS ? kIOSBundleId : kAndroidPackageId;

const String kAppName =
    String.fromEnvironment("APP_NAME", defaultValue: "Lenercom EMS");
const String kAppChannel =
    String.fromEnvironment("APP_CHANNEL", defaultValue: "oppo");

/// 版本信息
const Map kVersionInfo = {
  "id": 1,
  "version": "3.0.007",
  "versionCode": "30007",
  "companyName": "湖南能创科技有限责任公司",
  "companyEngName": null,
  "phone": "18975176521",
  "companyProfile": "湖南省长沙市岳麓区麓谷科技创新创业园B1栋12楼",
  "companyEngProfile": null,
  "companyAddress": "湖南省长沙市岳麓区麓谷科技创新创业园B1栋12楼",
  "companyEngAddress": null,
  "contactPhone": "0731-88051567",
  "email": "service@lenercom.com",
  "website": "www.lenercom.com",
  "bkImg": "cancreate/2021/3/18/04C9297E113E421DA2F9682B9CC333F4.jpg",
  "skypeContext": null,
  "skypeNo": null,
  "isValid": 0,
  "createTime": "2021-03-16 17:28:41"
};

/// 手机号code
const List<String> kTelCodeList = [
  "+1",
  "+7",
  "+20",
  "+27",
  "+30",
  "+31",
  "+32",
  "+33",
  "+34",
  "+36",
  "+39",
  "+40",
  "+41",
  "+43",
  "+44",
  "+45",
  "+46",
  "+47",
  "+48",
  "+49",
  "+51",
  "+52",
  "+53",
  "+54",
  "+55",
  "+56",
  "+57",
  "+58",
  "+60",
  "+61",
  "+62",
  "+63",
  "+64",
  "+65",
  "+66",
  "+81",
  "+82",
  "+84",
  "+86",
  "+90",
  "+91",
  "+92",
  "+94",
  "+95",
  "+98",
  "+212",
  "+213",
  "+216",
  "+218",
  "+220",
  "+221",
  "+222",
  "+223",
  "+224",
  "+225",
  "+226",
  "+227",
  "+228",
  "+229",
  "+230",
  "+231",
  "+232",
  "+233",
  "+234",
  "+235",
  "+236",
  "+237",
  "+238",
  "+239",
  "+240",
  "+241",
  "+242",
  "+243",
  "+244",
  "+245",
  "+248",
  "+249",
  "+250",
  "+251",
  "+252",
  "+253",
  "+254",
  "+255",
  "+256",
  "+257",
  "+258",
  "+260",
  "+261",
  "+262",
  "+263",
  "+264",
  "+265",
  "+266",
  "+267",
  "+268",
  "+269",
  "+290",
  "+291",
  "+297",
  "+298",
  "+350",
  "+351",
  "+352",
  "+353",
  "+354",
  "+355",
  "+356",
  "+357",
  "+358",
  "+359",
  "+370",
  "+371",
  "+372",
  "+373",
  "+374",
  "+375",
  "+376",
  "+377",
  "+378",
  "+380",
  "+381",
  "+382",
  "+385",
  "+386",
  "+387",
  "+389",
  "+420",
  "+421",
  "+423",
  "+501",
  "+502",
  "+503",
  "+504",
  "+505",
  "+506",
  "+507",
  "+509",
  "+591",
  "+592",
  "+593",
  "+594",
  "+595",
  "+597",
  "+598",
  "+670",
  "+672",
  "+673",
  "+674",
  "+675",
  "+676",
  "+677",
  "+678",
  "+679",
  "+680",
  "+682",
  "+683",
  "+686",
  "+687",
  "+688",
  "+690",
  "+691",
  "+692",
  "+850",
  "+852",
  "+853",
  "+855",
  "+856",
  "+880",
  "+886",
  "+960",
  "+961",
  "+962",
  "+963",
  "+964",
  "+965",
  "+966",
  "+967",
  "+968",
  "+970",
  "+971",
  "+972",
  "+973",
  "+974",
  "+975",
  "+976",
  "+977",
  "+992",
  "+993",
  "+994",
  "+996",
  "+998",
  "+1242",
  "+1246",
  "+1264",
  "+1268",
  "+1441",
  "+1473",
  "+1664",
  "+1671",
  "+1758",
  "+1784",
  "+1809",
  "+1868",
  "+1869",
  "+1876",
  "+6847",
  "+619162",
  "+619164",
  "+3906698"
];

class AppInfo {
  // 创建静态实例变量
  static final AppInfo _instance = AppInfo._internal();

  // 工厂方法
  factory AppInfo() => _instance;

  // 私有构造方法
  AppInfo._internal();

  // VIP提示文案配置
  Map<String, dynamic>? vip_prompt_wenan;

  // 实名认证开关
  bool? needCertification;

  // 账号注销冷静期天数
  int? logoff_calm_days;

  /// 客服QQ
  String? qqService;

  AppInfo init(Map<String, dynamic> vip_prompt_wenan, bool needCertification,
      int logoff_calm_days, String qqService) {
    _instance.vip_prompt_wenan = vip_prompt_wenan;
    _instance.needCertification = needCertification;
    _instance.logoff_calm_days = logoff_calm_days;
    _instance.qqService = qqService;

    return _instance;
  }

  /// 是否有推送权限
  static bool notificationPerm = true;

  /// 设备注册ID(推送使用)
  static String registrationId = '';

  /// 是否需要获取启动消息，默认需要
  static bool launchAppGetNotification = true;

  /// 当前电站类型
  static String? stationType;

  /// 高压机型型号列表
  static List<String> highVoltageModels = [];

  /// 低压机型型号列表
  static List<String> lowVoltageModels = [];
}
